<template>
  <div class="param-info" v-if="Object.keys(paramInfo).length > 0">
    <table
      v-for="(table, index) in paramInfo.sizes"
      class="info-size"
      :key="index"
    >
      <tr v-for="(tr, inder) in table" :key="inder">
        <td v-for="(td, inded) in tr" :key="inded">{{ td }}</td>
      </tr>
    </table>

    <table class="info-param">
      <tr v-for="(info, index) in paramInfo.infos" :key="index">
        <td class="info-param-key">{{ info.key }}</td>
        <td class="param-value">{{ info.value }}</td>
      </tr>
    </table>
    <div class="info-img" v-if="paramInfo.image.length !== 0">
      <img v-lazy="paramInfo.image" alt="" />
    </div>
    <!-- [[["尺码","S","M","L","XL"],["胸围","87","88","92","96"],["裙长","95","96","97","98"]]] 三行五列,-->
    <!--12个对象2内容，12行2列-->
  </div>
</template>

<script>
export default {
  name: "DetailParamInfo",
  props: {
    paramInfo: {
      type: Object,
      default() {
        return {};
      },
    },
  },
  data() {
    return {};
  },

  mounted() {},

  methods: {},
};
</script>

<style lang="less" scoped>
.param-info {
  padding: 20px 15px;
  font-size: 14px;
  border-bottom: 5px solid #f2f5f8;
  table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
    tr {
      height: 42px;
      td {
        border-right: 1px solid rgba(100, 100, 100, 0.1);
        border-bottom: 1px solid rgba(100, 100, 100, 0.1);
      }
    }
  }
  .info-param-key {
    /*当value的数据量比较大的时候, 会挤到key,所以给一个固定的宽度*/
    width: 95px;
  }
  .param-value {
    color: var(--color-tint);
  }

  .info-img img {
    width: 100%;
  }
}
</style>
